continue;
}
- priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
- if (IS_ERR(priv->pcs[pn])) {
- dev_err(priv->dev, "port %u failed to create PCS instance: %ld\n",
- pn, PTR_ERR(priv->pcs[pn]));
- priv->pcs[pn] = NULL;
- continue;
+ if (pcs_node) {
+ priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
+ if (IS_ERR(priv->pcs[pn])) {
+ dev_err(priv->dev, "port %u failed to create PCS instance: %ld\n",
+ pn, PTR_ERR(priv->pcs[pn]));
+ priv->pcs[pn] = NULL;
+ continue;
+ }
}
if (of_get_phy_mode(dn, &interface))
struct device_node *pcs_np;
struct rtpcs_ctrl *ctrl;
struct rtpcs_link *link;
- int sds;
-
- /*
- * RTL838x devices have a built-in octa port RTL8218B PHY that is not attached via
- * a SerDes. Allow to be called with an empty SerDes device node. In this case lookup
- * the parent/driver node directly.
- */
- if (np) {
- if (!of_device_is_available(np))
- return ERR_PTR(-ENODEV);
-
- if (of_property_read_u32(np, "reg", &sds))
- return ERR_PTR(-EINVAL);
+ u32 sds;
- pcs_np = of_get_parent(np);
- } else {
- pcs_np = of_find_compatible_node(NULL, NULL, "realtek,otto-pcs");
- sds = -1;
- }
+ if (!np || !of_device_is_available(np))
+ return ERR_PTR(-ENODEV);
+ pcs_np = of_get_parent(np);
if (!pcs_np)
return ERR_PTR(-ENODEV);
if (port < 0 || port > ctrl->cfg->cpu_port)
return ERR_PTR(-EINVAL);
- if (sds != -1 && rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
+ if (of_property_read_u32(np, "reg", &sds))
+ return ERR_PTR(-EINVAL);
+ if (rtpcs_sds_read(ctrl, sds, 0, 0) < 0)
return ERR_PTR(-EINVAL);
link = kzalloc(sizeof(*link), GFP_KERNEL);